package com.gxy.learn.design.model.construction.adapter.object_adapter;

import lombok.extern.slf4j.Slf4j;

/**
 * @description: 适配器类
 * @author: gaoxueyong
 * @Date: 2022/11/7 18:46
 */
@Slf4j
public class SDAdapterTF implements SDCard {

    private  TFCard tfCard;

    public SDAdapterTF(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    /**
     * 读取SD卡数据
     *
     * @return java.lang.String
     * @Author gaoxueyong
     * @Date 6:20 下午 2022/11/7
     * @Param []
     **/
    @Override
    public String readSD() {
        log.info("adapter read TFCard");
        return tfCard.readTF();
    }

    /**
     * 把数据写入SD卡
     *
     * @param msg
     * @return void
     * @Author gaoxueyong
     * @Date 6:20 下午 2022/11/7
     * @Param [msg]
     */
    @Override
    public void waireSD(String msg) {
        log.info("adapter write TFCard");
        tfCard.waireTF(msg);
    }
}
